<template>
  <div v-if="row.is_edit&&showActiveBtn">
    <create-document-dialog v-if="isDocument&&loading"  v-bind="$attrs" v-on="$listeners" :row="row" :path="detailUrl"></create-document-dialog>
    <create-dialog v-bind="$attrs" v-on="$listeners" :row="row"  v-else-if="loading" :path="detailUrl"></create-dialog>
  </div>
  <div v-else>
    <detail-document-dialog v-if="isDocument&&loading"  v-bind="$attrs" v-on="$listeners" :row="row" :path="detailUrl">
    </detail-document-dialog>
    <detail-dialog v-bind="$attrs" v-on="$listeners" :row="row"  v-else-if="loading" :path="detailUrl">
    </detail-dialog>
  </div>
</template>
<script>
    import allWorkflow from "@/api/allWorkflow/index";
    import DetailDialog from '@/components/WorkFlowsDialog/DetailDialog'
    import DetailDocumentDialog from "../../components/WorkFlowsDialog/DetailDocumentDialog";
    import CreateDocumentDialog from "@/components/WorkFlowsDialog/CreateDocumentDialog";
    import CreateDialog from "@/components/WorkFlowsDialog/CreateDialog";
    export default {
        name: "AllDetailDialog",
      components: {CreateDialog, CreateDocumentDialog, DetailDocumentDialog, DetailDialog},
      props:["info","isDaiyue","showActiveBtn"],
        data(){
          return{
              detailUrl:"",
              row:{},
              loading:false,
          }
        },
        computed:{
          isDocument(){
            return this.detailUrl.includes("officialDocument")
          }
        },
        watch:{
        },
        created() {
            this.detailUrl = this.info.workflow_info.duty_li_pc;
            if(this.isDaiyue){
              //  this.getDaiyueInfo()
            }else{
                this.getDetailInfo()
            }
        },
        methods:{
            getDetailInfo(){
                allWorkflow.getDetailInfo(this.info.id).then(res=>{
                    this.row = res.data;
                    this.loading = true
                })
            },
            getDaiyueInfo(){
                // schoolSignature.getDocumentById(this.info.id).then(res=>{
                //     this.row  = res.data
                //     this.loading = true
                // })
            }
        }
    }
</script>
<style lang="scss" scoped>
    .detailFormBox{
        ::v-deep.el-form{
            margin-right: 30px;
        }
    }
</style>
